import pickle
import random
import string

def student_name():
    # res = {chr(x):x for x in range(65,70)}
    # name = res
    s = ''
    for i in range(3):
        s += string.ascii_lowercase
    return s

def score():
    return random.randint(0,100)

obj=[
    {
        "StudentName": student_name(),
        "english": score(),
        "math": score()
    },
    {
        "StudentName": student_name(),
        "english": score(),
        "math": score()
    }
]
f = open("./tmp.txt", "wb")
# 将 obj 持久化保存到文件 tmp.txt 中
pickle.dump(obj, f)
del obj
f.close()

